package stool.abstractfactorypattern.part2;

import stool.abstractfactorypattern.part1.IUser;
import stool.abstractfactorypattern.part1.SqlserverUser;

/**
 * @Author Felix YF Dong
 * @Date 2021/5/7
 */
public class DataAccess {

    private static final String DB = "Sqlserver";

    public static IUser createUser() throws Exception {
        IUser iUser = null;
        switch (DB) {
            case "Sqlserver":
                iUser = new SqlserverUser();
                break;
            default:
                throw new Exception("");
        }
        return iUser;
    }
}
